package cn.wggf.dev.qcgg.pojo;

import java.util.Date;

/**
 * 
 * 用户类
 * 
 * @author Yubo Jia
 *
 */
public class User implements java.io.Serializable {
	// Fields
	/** 序列化 Id */
	private static final long serialVersionUID = -7979523422423967098L;
	/** 编号*/
	private Integer id;
	/** 姓名 */
	private String name;
	/** 昵称 */
	private String nickname;
	/** 性别 */
	private String gender;
	/** 出生日期 */
	private Date birthday;
	/** 手机号 */
	private String phone;
	/** 邮箱 */
	private String email;
	/** 国家 */
	private String country;
	/** 省份 */
	private String province;
	/** 城市 */
	private String city;
	/** 语言 */
	private String language;

	// Constructors
	/** default constructor */
	public User() {
	}

	// Property accessors
	// Getters and Setters
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	// hashCode() and equals()
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		
		return result;
	}

	public boolean equals(Object o) {
		if (o != null) {
			if (this == o) {
				return true;
			}
			
			if (o instanceof User) {
				User u = (User) o;
				
				if (this.id == null || u.id == null) {
					return false;
				} else if (!this.id.equals(u.id)) {
					return false;
				}
				
				return true;
			}
		}

		return false;
	}
}